<?php

/**
 * UserOrder form.
 *
 * @package    test_cart
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrinePluginFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class UserOrderForm extends PluginUserOrderForm
{

    public function configure()
    {
        // override email validator         
        $this->setValidator('email', new sfValidatorRegex(
                        array('pattern'    => '/^[a-z][a-z0-9_.-]*@[a-z0-9.-]+[.][a-z]{2,}$/ii',
                            'max_length' => 255,
                            'required'   => true
                        ),
                        array(
                            'invalid'    => 'Only email format is allowed.',
                            'max_length' => 'shouldn’t exceed 255  Characters',
                        )
                )
        );
        // override phone validator
        $this->setValidator('phone', new sfValidatorString());

        unset($this['created_at'], $this['updated_at'], $this['address'], $this['zip_code'], $this['transaction_id'], $this['status_code'], $this['order_status']);
        $this->addFormatter('CustomFormatter');
    }

}